Link to this headingFonts

Link to this headingTrue Type Fonts (TTF)

Better for screens

Apples Reference Manual for TTF

Parse TTF:

import struct import sys def read_ttf_tables(file_path): with open(file_path, 'rb') as f: # Read the offset table sfnt_version = f.read(4) num_tables, search_range, entry_selector, range_shift = struct.unpack('>HHHH', f.read(8)) print(f"Font file: {file_path}") print(f"Number of tables: {num_tables}\n") print(f"{'Tag':<10} {'Checksum':>12} {'Offset':>12} {'Length':>12}") print("-" * 50) # Each table record is 16 bytes long for _ in range(num_tables): # Read 16 bytes: tag (4), checksum (4), offset (4), length (4) record = f.read(16) tag, checksum, offset, length = struct.unpack('>4sIII', record) tag = tag.decode('ascii') print(f"{tag:<10} {checksum:>12} {offset:>12} {length:>12}") if __name__ == "__main__": if len(sys.argv) < 2: print("Usage: python read_ttf_tables.py <path_to_font.ttf>") else: read_ttf_tables(sys.argv[1])
DSIG | Digital Signature Table GSUB | Glyph Substitution Table OS/2 | OS/2 and Windows Metrics Table TTFA | ttfautohint paramater table cmap | Character to Glyph Index Mapping Table cvt | Control Value Table fpgm | Font Program gasp | Grid-fitting and Scan-conversion Procedure Table glyf | Glyph Data head | Font Header Table hhea | Horizontal Header Table hmtx | Horizontal Metrics Table loca | Index to Location maxp | Maximum Profile name | Naming Table post | PostScript Table prep | Control Value Program

Link to this headingOpenType Fonts (OTF)

Better for printing and supports Advanced (ligatures, glyphs, alternates)

Link to this headingWeb Open Font Format (WOFF & WOFF2)

Used for Websites